// NewPageNameDlg.cpp : implementation file
//

#include "stdafx.h"
#include "BtnTool.h"
#include "NewPageNameDlg.h"
#include "afxdialogex.h"
#include "StringUtility.h"

using namespace std;

// CNewPageNameDlg dialog

IMPLEMENT_DYNAMIC(CNewPageNameDlg, CDialogEx)

string CNewPageNameDlg::SetNewPageName()
{
	DoModal();

	return m_NewPageName;
}

CNewPageNameDlg::CNewPageNameDlg(CWnd* pParent /*=NULL*/)
	: CDialogEx(CNewPageNameDlg::IDD, pParent)
{

}

CNewPageNameDlg::~CNewPageNameDlg()
{
}

void CNewPageNameDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CNewPageNameDlg, CDialogEx)
	ON_BN_CLICKED(IDOK, &CNewPageNameDlg::OnBnClickedApplyBtn)
	ON_BN_CLICKED(IDCANCEL, &CNewPageNameDlg::OnBnClickedCancellBtn)
END_MESSAGE_MAP()


// CNewPageNameDlg message handlers


void CNewPageNameDlg::OnBnClickedApplyBtn()
{
	CString name;
	GetDlgItemText(IDC_NAME_EDIT, name);
	m_NewPageName = CStringToString(name);

	OnOK();
}


void CNewPageNameDlg::OnBnClickedCancellBtn()
{
	m_NewPageName = "";

	OnCancel();
}
